package org.dromara.administration.mapper;

import org.apache.ibatis.annotations.Param;
import org.dromara.administration.domain.AdmApplyRelation;
import org.dromara.administration.domain.vo.AdmApplyRelationVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;

import java.util.List;

/**
 * 申请关系Mapper接口
 *
 * @author LUSH
 * @date 2025-05-21
 */
public interface AdmApplyRelationMapper extends BaseMapperPlus<AdmApplyRelation, AdmApplyRelationVo> {

    /**
     * 查询当前用户作为申请人申请的sealId
     */
    List<Long> selectSealIdsByApplicantId(@Param("applicantId") Long applicantId);

    /**
     * 查询当前用户作为审核人需要审核的sealId
     */
    List<Long> selectSealIdsByPrincipalId(@Param("principalId") Long principalId);

    /**
     * 物理删除指定sealId的所有关系记录
     * @param sealId 公章申请ID
     * @return 删除的记录数
     */
    int deletePhysicalBySealId(@Param("sealId") Long sealId);
}
